// pages/shop/components/tableware.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    
  },

  /**
   * 组件的初始数据
   */
  data: {
    data:[
      {title:'无需餐具',index:0},
      {title:'1份',index:1},
      {title:'2份',index:2},
      {title:'3份',index:3},
      {title:'4份',index:4},
      {title:'5份',index:5},
      {title:'6份',index:6},
      {title:'7份',index:7},
      {title:'8份',index:8},
      {title:'9份',index:9},
      {title:'10份',index:10},
      {title:'10份以上',index:1},
    ],
    tablewareType:false
  },

  /**
   * 组件的方法列表
   */
  methods: {
    typeClick(){
      this.data.tablewareType = !this.data.tablewareType
      this.setData({
        tablewareType:this.data.tablewareType
      })
    },
    chooseClick(index){
      this.triggerEvent('saveTableware', this.data.data[index.currentTarget.dataset.index])
      this.typeClick()
    }
  }
})
